package cn.kone.system.auth;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component //出创建对象交给Spring管理
@Slf4j //lombok事务注解
public class PermissionScanRunner implements CommandLineRunner {
    @Autowired
    private PermissionScan permissionScan;


    @Override
    public void run(String... args) throws Exception {

        new Thread(new Runnable() {
            @Override
            public void run() {
                log.info("------start----------这是Spring自己提供的CommandLineRunner----------------");
                permissionScan.scanPermission();
                log.info("------stop----------这是Spring自己提供的CommandLineRunner----------------");
            }
        }).start();

    }
}
